package yunquan.wang.modules.base.entity;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import yunquan.wang.base.domain.IdEntity;

import com.google.common.collect.Lists;
@Entity
@Table(name = "base_message")
public class Messages extends IdEntity {
	@Column(name = "title",length=100)
	private String title;//标题	
	@Column(name = "recevie_userids",length=100)
	private String recevieUserIds;//接受者ID
	@Column(name = "recevie_usernames",length=200)
	private String recevieUsernames;//接受者姓名
	@Column(name = "sendDate")
	private Date sendDate;//发送日期
	@Column(name = "success", length=1)
	private Boolean success;//是否成功
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "send_userid")
	private UserBasic sendUser;//发送者
	@Column(name = "senddelete", length=1)
	private Boolean senddelete;//发送者删除
	@Column(name = "content",length=500)
	private String content;//内容
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "messages")
	private	 List<AttachmentInfo> attachmentInfos=Lists.newArrayList();//附件
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "messages")
	private List<RecevieMessage> recevieMessages=Lists.newArrayList();
	
	public List<RecevieMessage> getRecevieMessages() {
		return recevieMessages;
	}
	public void setRecevieMessages(List<RecevieMessage> recevieMessages) {
		this.recevieMessages = recevieMessages;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getRecevieUserIds() {
		return recevieUserIds;
	}
	public void setRecevieUserIds(String recevieUserIds) {
		this.recevieUserIds = recevieUserIds;
	}
	public String getRecevieUsernames() {
		return recevieUsernames;
	}
	public void setRecevieUsernames(String recevieUsernames) {
		this.recevieUsernames = recevieUsernames;
	}
	public Date getSendDate() {
		return sendDate;
	}
	public void setSendDate(Date sendDate) {
		this.sendDate = sendDate;
	}
	public Boolean getSuccess() {
		return success;
	}
	public void setSuccess(Boolean success) {
		this.success = success;
	}
	public UserBasic getSendUser() {
		return sendUser;
	}
	public void setSendUser(UserBasic sendUser) {
		this.sendUser = sendUser;
	}
	public Boolean getSenddelete() {
		return senddelete;
	}
	public void setSenddelete(Boolean senddelete) {
		this.senddelete = senddelete;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public List<AttachmentInfo> getAttachmentInfos() {
		return attachmentInfos;
	}
	public void setAttachmentInfos(List<AttachmentInfo> attachmentInfos) {
		this.attachmentInfos = attachmentInfos;
	}
 
	
	
}
